import http from "@/config/config";

const tagApi ={
     
    getTags:()=>{
         return http.get('/tag').then(res=>{
             return res.data;
         })
    },
    //添加标签
    addTag:(tag:String)=>{
        return http.post('/tag/add',{
            "tag":tag
        }).then(res=>{
            return res.data;
       })
    },
    //修改标签
    updateTag:(tag:any)=>{
        return http.put('/tag/update',{
            "id":tag.id,
            "tag":tag.tag
        }).then(res=>{
            return res.data;
        })
    },
    //批量删除标签
    deleteTags:(ids:any)=>{
        return http.post('/tag/delete',{
            "ids":ids
        }).then(res=>{
            return res.data;
        })
    }

}

export default tagApi;

